//
//  ZFBNavigationController.m
//  支付宝
//
//  Created by HaoYoson on 16/6/27.
//  Copyright © 2016年 HaoYoson. All rights reserved.
//

#import "UIColor+Addition.h"
#import "ZFBNavigationController.h"

@interface ZFBNavigationController ()

@end

@implementation ZFBNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    // 设置背景图为空图
    [self.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
    // 设置线为空图
    [self.navigationBar setShadowImage:[[UIImage alloc] init]];
    // 取消半透明模式
    self.navigationBar.translucent = NO;
    // 所有标题为白色
    [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
    // bar+状态栏 为黑色
    [self.navigationBar setBarTintColor:[UIColor colorWithHex:0x3a3a3a]];
    // 渲染颜色 白色
    [self.navigationBar setTintColor:[UIColor whiteColor]];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//- (UIViewController *)childViewControllerForStatusBarStyle {
//    return self.topViewController;
//}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (self.viewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:animated];
}

@end
